 
import { FactoryTaskHelper } from "GameLoop/WorldState/EntityManager/Entitys/room/factory/FactoryTaskHelper";
import { priority } from "utils/constants/definetypes";
import { generateUniqueId } from "utils/utils";

 

export default 
{
     
    factory:{
        
        produce(room:string, resourceType: CommodityConstant,amount:number,p:number=priority.D)
        {
           
            const task:ITask<IFactoryTaskData<"produce">>={
                id:generateUniqueId(),
                priority:p,
                ttl:-1,
                type:"factory",
                data:{
                    type:"produce",
                    arg: FactoryTaskHelper.getProduceTaskArg(resourceType,amount),
                },
                shard: 1,
            }
            Game.rooms[room].addNewTask(task);
        }
    }
}